package com.zygh.policeasset.mapper;

import com.zygh.policeasset.pojo.AssetCodeAuxiliary;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.type.JdbcType;

@Mapper
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/mapper/AssetCodeAuxiliaryMapper.class */
public interface AssetCodeAuxiliaryMapper {
    @Select({"select count(*) from asset_code_auxiliary " +
            "where time_num = #{timeNum} and serial_num = #{serialNum} and  type = #{type} "})
    Integer findCount(@Param("timeNum") String str, @Param("serialNum") Integer num, @Param("type") String str2);

    @Insert({"insert into asset_code_auxiliary (time_num,serial_num,type) values(#{timeNum},#{serialNum},#{type}) "})
    Integer add(AssetCodeAuxiliary assetCodeAuxiliary);

    @Results({@Result(column = "time_num", property = "timeNum", jdbcType = JdbcType.VARCHAR), @Result(column = "serial_num", property = "serialNum", jdbcType = JdbcType.VARCHAR), @Result(column = "assets_num", property = "assetsNum", jdbcType = JdbcType.VARCHAR)})
    @Select({"select * from asset_code_auxiliary where time_num = #{timeNum} and  type = #{type} and serial_num = #{serialNum}  and assets_num IS NOT NULL "})
    AssetCodeAuxiliary findAssetCodeAuxiliary(@Param("timeNum") String str, @Param("type") String str2, @Param("serialNum") Integer num);

    @Update({"UPDATE asset_code_auxiliary SET assets_num = #{assetsNum} WHERE time_num = #{timeNum} and TYPE = #{type}  and  serial_num = #{serialNum} ORDER BY id ASC  LIMIT 1  "})
    Integer updateAssetsNum(@Param("timeNum") String str, @Param("type") String str2, @Param("assetsNum") String str3, @Param("serialNum") Integer num);
}